/* **********************************************************************************
*
* Copyright (c) Microsoft Corporation. All rights reserved.
*
* This source code is subject to terms and conditions of the Shared Source License
* for DSL Editor PowerToy. A copy of the license can be found in the License.htm file
* at the root of this distribution. If you can not locate the Shared Source License
* for DSL Editor PowerToy, please obtain a copy from: http://www.codeplex.com/dsltreegrideditor/Project/License.aspx.
* By using this source code in any fashion, you are agreeing to be bound by
* the terms of the Shared Source License for DSL Editor PowerToy.
*
* You must not remove this notice, or any other, from this software.
*
* **********************************************************************************/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel.Design;

using Microsoft.VisualStudio.Shell.Interop;

namespace DslEditorPowerToy.Controls.Languages
{
    /// <summary>
    /// Class that provides selected components
    /// </summary>
    public class SelectionProvider : ISelectionProvider
    {
        private ISelectionService _selectionService = null;

        #region Constructors
        public SelectionProvider(ISelectionService service)
        {
            this._selectionService = service;
        }
        [CLSCompliant(false)]
        public SelectionProvider(ISelectionContainer container)
        {
            this._selectionService = new SelectionContainerSelectionService(container);
        }
        #endregion

        #region ISelectionProvider Members

        public ICollection GetSelectedComponents()
        {
            return this._selectionService.GetSelectedComponents();
        }

        public object PrimarySelection
        {
            get
            {
                return this._selectionService.PrimarySelection;
            }
        }

        public int SelectionCount
        {
            get
            {
                return this._selectionService.SelectionCount;
            }
        }

        #endregion
    }
}
